/**
 * This file is part of 1genia trampoline
 * Copyright (C) 2007 1genia (contact@1genia.com)
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; version 3 of the License. 
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details. 
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; see the file COPYING.TXT.  If not,
 * write to the Free Software Foundation, Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301, USA. 
 **/
package com.genia.toolbox.uml_generator.manager;

import com.genia.toolbox.basics.exception.technical.TechnicalIOException;
import com.genia.toolbox.uml_generator.bean.ModelGeneratorContext;
import com.genia.toolbox.uml_generator.model.AbstractDelegatableObject;

/**
 * Manage all that is related to delegate.
 */
public interface DelegateManager
{

  /**
   * this method prints the declaration of the delegate and the call to the
   * delegate methods for operations.
   * 
   * @param <T>
   *          the type of the {@link Appendable}
   * @param out
   *          the {@link Appendable} to print to
   * @param delegatable
   *          the object that has method to delegate
   * @return the {@link Appendable} that has been print to
   * @throws TechnicalIOException
   *           when an I/O error occurred
   */
  public <T extends Appendable> T printDelegateCall(T out, AbstractDelegatableObject delegatable)
      throws TechnicalIOException;



  /**
   * generate the Delegate class for the model. the context of the generation
   * 
   * @param context
   *          the context of the generation
   * @param delegatable
   *          the delegatable to generate the class for
   * @throws TechnicalIOException
   *           when an I/O error occurred
   */
  public void generateDelegate(ModelGeneratorContext context, AbstractDelegatableObject delegatable)
      throws TechnicalIOException;

}
